//
//  BaseNaviViewController.m
//  LXStory
//
//  Created by xushichuan on 2018/7/26.
//  Copyright © 2018年 xushichuan. All rights reserved.
//

#import "BaseNaviViewController.h"

@interface BaseNaviViewController ()

@end

@implementation BaseNaviViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

#pragma mark - 重写父类方法
//- (instancetype)initWithRootViewController:(UIViewController *)rootViewController
//{
//    XSCNavigationBar *naviBar = [XSCNavigationBar createGlobalNavigationBar];
//    [self setValue:naviBar forKey:@"navigationBar"];
//    return [super initWithRootViewController:rootViewController];
//}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    if (self.childViewControllers.count > 0) {
        // 设置导航栏
//        [self setupNavigationWithViewController:viewController];
        // 隐藏tabbar
        viewController.hidesBottomBarWhenPushed = YES;
    }
    // 调用父类方法
    [super pushViewController:viewController animated:YES];
}

//// 设置导航栏
//- (void)setupNavigationWithViewController:(UIViewController *)viewController
//{
//    UIBarButtonItem *backItem = [UIBarButtonItem createBarButtonItem:CGRectMake(0, 0, 30, 30) imageName:@"navi_back" target:self action:@selector(popViewControllerAnimated:)];
//    viewController.navigationItem.leftBarButtonItem = backItem;
//}

@end
